package com.shop.cloud.domain.system;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.shop.cloud.common.mybatis.BaseEntity;

import lombok.EqualsAndHashCode;
import lombok.ToString;

@ToString(callSuper = true)
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" }, ignoreUnknown = true)
public class SysResource extends BaseEntity{

	private static final long serialVersionUID = 1L;
    
	/**
	 * 排序号
	 */
    private Long sortNo;
	/**
	 * 最后更新人
	 */
    private Long updateUser;
	/**
	 * 父级id
	 */
    private Long parentId;
	/**
	 * 菜单资源名称
	 */
    private String name;
	/**
	 * 菜单资源简要描述
	 */
    private String remark;
	/**
	 * 记录生成人
	 */
    private Long createUser;
	/**
	 * 记录生成时间
	 */
    private Date createDate;
	/**
	 * 菜单资源URL
	 */
    private String url;
	/**
	 * 菜单的层级结构
	 */
    private String structure;
	/**
	 * 最后更新时间
	 */
    private Date updateDate;
    
    private Integer isMenu;
    
    private String parentName;
    
    private int status;
    
    private List<SysResource> resources=new ArrayList<SysResource>();
    
    private String roleIds;
    
    private boolean lastNode;
    
    //职位id
    private Long positionId;
    //后台权限
    private Integer authority;
    //用户
    private Long userId;
    
	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getPositionId() {
		return positionId;
	}

	public void setPositionId(Long positionId) {
		this.positionId = positionId;
	}

	public Integer getAuthority() {
		return authority;
	}

	public void setAuthority(Integer authority) {
		this.authority = authority;
	}

	public SysResource(){}
    
    public String getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(String roleIds) {
		this.roleIds = roleIds;
	}

	public int getStatus() {
		return status;
	}
    
    public void setStatus(int status) {
		this.status = status;
	}
    
    public boolean isLastNode() {
		return lastNode;
	}

	public void setLastNode(boolean lastNode) {
		this.lastNode = lastNode;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public Integer getIsMenu() {
		return isMenu;
	}

	public void setIsMenu(Integer isMenu) {
		this.isMenu = isMenu;
	}

	public Long getSortNo() {
        return this.sortNo;
    }
    
    public void setSortNo(Long sortNo) {
        this.sortNo = sortNo;
    }
    public Long getUpdateUser() {
        return this.updateUser;
    }
    
    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }
    public Long getParentId() {
        return this.parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    public String getRemark() {
        return this.remark;
    }
    
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public Long getCreateUser() {
        return this.createUser;
    }
    
    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }
    public Date getCreateDate() {
        return this.createDate;
    }
    
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }
    public String getStructure() {
        return this.structure;
    }
    
    public void setStructure(String structure) {
        this.structure = structure;
    }
    public Date getUpdateDate() {
        return this.updateDate;
    }
    
    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }
    
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}

	public List<SysResource> getResources() {
		return resources;
	}
	
	public void setResources(List<SysResource> resources) {
		this.resources = resources;
	}
}